home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcl / sptmbr11.lha / clx / display.lisp < prev    next >
Lisp/Scheme  |  1991-08-11  |  21KB  |  520 lines

  1. ;;; -*- Mode: LISP; Syntax: Common-lisp; Package: XLIB; Base: 10; Lowercase: Yes -*-
  2.  
  3. ;;; This file contains definitions for the DISPLAY object for Common-Lisp X windows version 11
  4.  
  5. ;;;
  6. ;;;             TEXAS INSTRUMENTS INCORPORATED
  7. ;;;                  P.O. BOX 2909
  8. ;;;                   AUSTIN, TEXAS 78769
  9. ;;;
  10. ;;; Copyright (C) 1987 Texas Instruments Incorporated.
  11. ;;;
  12. ;;; Permission is granted to any individual or institution to use, copy, modify,
  13. ;;; and distribute this software, provided that this complete copyright and
  14. ;;; permission notice is maintained, intact, in all copies and supporting
  15. ;;; documentation.
  16. ;;;
  17. ;;; Texas Instruments Incorporated provides this software "as is" without
  18. ;;; express or implied warranty.
  19. ;;;
  20.  
  21. (in-package :xlib)
  22.  
  23. ;;
  24. ;; Resource id management
  25. ;;
  26. (defun initialize-resource-allocator (display)
  27.   ;; Find the resource-id-byte (appropriate for LDB & DPB) from the resource-id-mask
  28.   (let ((id-mask (display-resource-id-mask display)))
  29.     (unless (zerop id-mask) ;; zero mask is an error
  30.       (do ((first 0 (index1+ first))
  31.        (mask id-mask (the mask32 (ash mask -1))))
  32.       ((oddp mask)
  33.        (setf (display-resource-id-byte display)
  34.          (byte (integer-length mask) first)))
  35.     (declare (type array-index first)
  36.          (type mask32 mask))))))
  37.  
  38. (defun resourcealloc (display)
  39.   ;; Allocate a resource-id for in DISPLAY
  40.   (declare (type display display))
  41.   (declare (values resource-id))
  42.   (dpb (incf (display-resource-id-count display))
  43.        (display-resource-id-byte display)
  44.        (display-resource-id-base display)))
  45.  
  46. (defmacro allocate-resource-id (display object type)
  47.   ;; Allocate a resource-id for OBJECT in DISPLAY
  48.   (if (member (eval type) *clx-cached-types*)
  49.       `(let ((id (funcall (display-xid ,display) ,display)))
  50.      (save-id ,display id ,object)
  51.      id)
  52.     `(funcall (display-xid ,display) ,display)))
  53.  
  54. (defmacro deallocate-resource-id (display id type)
  55.   ;; Deallocate a resource-id for OBJECT in DISPLAY
  56.   (when (member (eval type) *clx-cached-types*)
  57.     `(deallocate-resource-id-internal ,display ,id)))
  58.  
  59. (defun deallocate-resource-id-internal (display id)
  60.   (remhash id (display-resource-id-map display)))
  61.  
  62. (defun lookup-resource-id (display id)
  63.   ;; Find the object associated with resource ID
  64.   (gethash id (display-resource-id-map display)))
  65.  
  66. (defun save-id (display id object)
  67.   ;; Register a resource-id from another display.
  68.   (declare (type display display)
  69.        (type integer id)
  70.        (type t object))
  71.   (declare (values object))
  72.   (setf (gethash id (display-resource-id-map display)) object))
  73.  
  74. ;; Define functions to find the CLX data types given a display and resource-id
  75. ;; If the data type is being cached, look there first.
  76. (macrolet ((generate-lookup-functions (useless-name &body types)
  77.         `(within-definition (,useless-name generate-lookup-functions)
  78.            ,@(mapcar
  79.            #'(lambda (type)
  80.                `(defun ,(xintern 'lookup- type)
  81.                    (display id)
  82.               (declare (type display display)
  83.                    (type resource-id id))
  84.               (declare (values ,type))
  85.               ,(if (member type *clx-cached-types*)
  86.                    `(let ((,type (lookup-resource-id display id)))
  87.                   (cond ((null ,type) ;; Not found, create and save it.
  88.                      (setq ,type (,(xintern 'make- type)
  89.                               :display display :id id))
  90.                      (save-id display id ,type))
  91.                     ;; Found.  Check the type
  92.                     ,(cond ((null *type-check?*)
  93.                         `(t ,type))
  94.                            ((member type '(window pixmap))
  95.                         `((type? ,type 'drawable) ,type))
  96.                            (t `((type? ,type ',type) ,type)))
  97.                     ,@(when *type-check?*
  98.                         `((t (x-error 'lookup-error
  99.                               :id id
  100.                               :display display
  101.                               :type ',type
  102.                               :object ,type))))))
  103.                    ;; Not being cached.  Create a new one each time.
  104.                    `(,(xintern 'make- type)
  105.                  :display display :id id))))
  106.            types))))
  107.   (generate-lookup-functions ignore
  108.     drawable
  109.     window
  110.     pixmap
  111.     gcontext
  112.     cursor
  113.     colormap
  114.     font))
  115.  
  116. (defun id-atom (id display)
  117.   ;; Return the cached atom for an atom ID
  118.   (declare (type resource-id id)
  119.        (type display display))
  120.   (declare (values (or null keyword)))
  121.   (gethash id (display-atom-id-map display)))
  122.  
  123. (defun atom-id (atom display)
  124.   ;; Return the ID for an atom in DISPLAY
  125.   (declare (type xatom atom)
  126.        (type display display))
  127.   (declare (values (or null resource-id)))
  128.   (gethash (if (or (null atom) (keywordp atom)) atom (kintern atom))
  129.        (display-atom-cache display)))
  130.  
  131. (defun set-atom-id (atom display id)
  132.   ;; Set the ID for an atom in DISPLAY
  133.   (declare (type xatom atom)
  134.        (type display display)
  135.        (type resource-id id))
  136.   (declare (values resource-id))
  137.   (let ((atom (if (or (null atom) (keywordp atom)) atom (kintern atom))))
  138.     (setf (gethash id (display-atom-id-map display)) atom)
  139.     (setf (gethash atom (display-atom-cache display)) id)
  140.     id))
  141.  
  142. (defsetf atom-id set-atom-id)
  143.  
  144. (defun initialize-predefined-atoms (display)
  145.   (dotimes (i (length *predefined-atoms*))
  146.     (declare (type resource-id i))
  147.     (setf (atom-id (svref *predefined-atoms* i) display) i)))
  148.  
  149. (defun visual-info (display visual-id)
  150.   (declare (type display display)
  151.        (type resource-id visual-id)
  152.        (values visual-info))
  153.   (when (zerop visual-id)
  154.     (return-from visual-info nil))
  155.   (dolist (screen (display-roots display))
  156.     (declare (type screen screen))
  157.     (dolist (depth (screen-depths screen))
  158.       (declare (type cons depth))
  159.       (dolist (visual-info (rest depth))
  160.     (declare (type visual-info visual-info))
  161.     (when (funcall (resource-id-map-test) visual-id (visual-info-id visual-info))
  162.       (return-from visual-info visual-info)))))
  163.   (error "Visual info not found for id #x~x in display ~s." visual-id display))
  164.  
  165.  
  166. ;;
  167. ;; Display functions
  168. ;;
  169. (defmacro with-display ((display &key timeout inline)
  170.             &body body)
  171.   ;; This macro is for use in a multi-process environment.  It provides exclusive
  172.   ;; access to the local display object for multiple request generation.  It need not
  173.   ;; provide immediate exclusive access for replies; that is, if another process is
  174.   ;; waiting for a reply (while not in a with-display), then synchronization need not
  175.   ;; (but can) occur immediately.  Except where noted, all routines effectively
  176.   ;; contain an implicit with-display where needed, so that correct synchronization
  177.   ;; is always provided at the interface level on a per-call basis.  Nested uses of
  178.   ;; this macro will work correctly.  This macro does not prevent concurrent event
  179.   ;; processing; see with-event-queue.
  180.   `(with-buffer (,display
  181.          ,@(and timeout `(:timeout ,timeout))
  182.          ,@(and inline `(:inline ,inline)))
  183.      ,@body))
  184.  
  185. (defmacro with-event-queue ((display &key timeout inline)
  186.                 &body body &environment env)
  187.   ;; exclusive access to event queue
  188.   `(macrolet ((with-event-queue ((display &key timeout) &body body)
  189.         ;; Speedup hack for lexically nested with-event-queues
  190.         `(progn
  191.            (progn ,display ,@(and timeout `(,timeout)) nil)
  192.            ,@body)))
  193.      ,(if (and (null inline) (macroexpand '(use-closures) env))
  194.       `(flet ((.with-event-queue-body. () ,@body))
  195.          #+clx-ansi-common-lisp
  196.          (declare (dynamic-extent #'.with-event-queue-body.))
  197.          (with-event-queue-function
  198.            ,display ,timeout #'.with-event-queue-body.))
  199.     (let ((disp (if (or (symbolp display) (constantp display))
  200.             display
  201.               '.display.)))
  202.       `(let (,@(unless (eq disp display) `((,disp ,display))))
  203.          (holding-lock ((display-event-lock ,disp) ,disp "CLX Event Lock"
  204.                 ,@(and timeout `(:timeout ,timeout)))
  205.            ,@body))))))
  206.  
  207. (defun with-event-queue-function (display timeout function)
  208.   (declare (type display display)
  209.        (type (or null number) timeout)
  210.        (type function function)
  211.        #+clx-ansi-common-lisp
  212.        (dynamic-extent function)
  213.        #+(and lispm (not clx-ansi-common-lisp))
  214.        (sys:downward-funarg function))
  215.   (with-event-queue (display :timeout timeout :inline t)
  216.     (funcall function)))
  217.  
  218. (defmacro with-event-queue-internal ((display &key timeout) &body body)
  219.   ;; exclusive access to the internal event queues
  220.   (let ((disp (if (or (symbolp display) (constantp display)) display '.display.)))
  221.     `(let (,@(unless (eq disp display) `((,disp ,display))))
  222.        (holding-lock ((display-event-queue-lock ,disp) ,disp "CLX Event Queue Lock"
  223.               ,@(and timeout `(:timeout ,timeout)))
  224.      ,@body))))
  225.  
  226. (defun open-display (host  &rest options &key (display 0) protocol
  227.              authorization-name authorization-data &allow-other-keys)
  228.   ;; Implementation specific routine to setup the buffer for a specific host and display.
  229.   ;; This must interface with the local network facilities, and will probably do special
  230.   ;; things to circumvent the nework when displaying on the local host.
  231.   ;;
  232.   ;; A string must be acceptable as a host, but otherwise the possible types
  233.   ;; for host and protocol are not constrained, and will likely be very
  234.   ;; system dependent.  The default protocol is system specific.  Authorization,
  235.   ;; if any, is assumed to come from the environment somehow.
  236.   (declare (type integer display)
  237.        (dynamic-extent options))
  238.   (declare (values display))
  239.   ;; PROTOCOL is the network protocol (something like :TCP :DNA or :CHAOS). See OPEN-X-STREAM.
  240.   (let* ((stream (open-x-stream host display protocol))
  241.      (disp (apply #'make-buffer
  242.               *output-buffer-size*
  243.               'make-display-internal
  244.               :host host
  245.               :display display
  246.               :output-stream stream
  247.               :input-stream stream
  248.               :allow-other-keys t
  249.               options))
  250.      (ok-p nil))
  251.     (unwind-protect
  252.     (progn
  253.       (display-connect disp
  254.                :authorization-name authorization-name
  255.                :authorization-data authorization-data)
  256.       (initialize-resource-allocator disp)
  257.       (initialize-predefined-atoms disp)
  258.       (initialize-extensions disp)
  259.       (setq ok-p t))
  260.       (unless ok-p (close-display disp :abort t)))
  261.     disp))
  262.  
  263. (defun display-force-output (display)
  264.   ; Output is normally buffered, this forces any buffered output to the server.
  265.   (declare (type display display))
  266.   (with-display (display)
  267.     (buffer-force-output display)))
  268.  
  269. (defun close-display (display &key abort)
  270.   ;; Close the host connection in DISPLAY
  271.   (declare (type display display))
  272.   (close-buffer display :abort abort))
  273.  
  274. (defun display-connect (display &key authorization-name authorization-data)
  275.   (unless authorization-name (setq authorization-name ""))
  276.   (unless authorization-data (setq authorization-data ""))
  277.   (with-buffer-output (display :sizes (8 16))
  278.     (card8-put
  279.       0
  280.       (ecase (display-byte-order display)
  281.     (:lsbfirst #x6c)   ;; Ascii lowercase l - Least Significant Byte First
  282.     (:msbfirst #x42))) ;; Ascii uppercase B -  Most Significant Byte First
  283.     (card16-put 2 *protocol-major-version*)
  284.     (card16-put 4 *protocol-minor-version*)
  285.     (card16-put 6 (length authorization-name))
  286.     (card16-put 8 (length authorization-data))
  287.     (write-sequence-char display 12 authorization-name)
  288.     (write-sequence-char display
  289.              (lround (+ 12 (length authorization-name))) authorization-data))
  290.   (buffer-force-output display)
  291.   (let ((reply-buffer nil))
  292.     (declare (type (or null reply-buffer) reply-buffer))
  293.     (unwind-protect
  294.     (progn
  295.       (setq reply-buffer (allocate-reply-buffer #x1000))
  296.       (with-buffer-input (reply-buffer :sizes (8 16 32))
  297.         (buffer-input display buffer-bbuf 0 8)
  298.         (let ((success (boolean-get 0))
  299.           (reason-length (card8-get 1))
  300.           (major-version (card16-get 2))
  301.           (minor-version (card16-get 4))
  302.           (total-length (card16-get 6))
  303.           vendor-length
  304.           num-roots
  305.           num-formats)
  306.           (declare (ignore total-length))
  307.           (unless success
  308.         (x-error 'connection-failure
  309.              :major-version major-version
  310.              :minor-version minor-version
  311.              :host (display-host display)
  312.              :display (display-display display)
  313.              :reason
  314.              (progn (buffer-input display buffer-bbuf 0 reason-length)
  315.                 (string-get reason-length 0 :reply-buffer reply-buffer))))
  316.           (buffer-input display buffer-bbuf 0 32)
  317.           (setf (display-protocol-major-version display) major-version)
  318.           (setf (display-protocol-minor-version display) minor-version)
  319.           (setf (display-release-number display) (card32-get 0))
  320.           (setf (display-resource-id-base display) (card32-get 4))
  321.           (setf (display-resource-id-mask display) (card32-get 8))
  322.           (setf (display-motion-buffer-size display) (card32-get 12))
  323.           (setq vendor-length (card16-get 16))
  324.           (setf (display-max-request-length display) (card16-get 18))
  325.           (setq num-roots (card8-get 20))
  326.           (setq num-formats (card8-get 21))
  327.           ;; Get the image-info
  328.           (setf (display-image-lsb-first-p display) (zerop (card8-get 22)))
  329.           (let ((format (display-bitmap-format display)))
  330.         (declare (type bitmap-format format))
  331.         (setf (bitmap-format-lsb-first-p format) (zerop (card8-get 23)))
  332.         (setf (bitmap-format-unit format) (card8-get 24))
  333.         (setf (bitmap-format-pad format) (card8-get 25)))
  334.           (setf (display-min-keycode display) (card8-get 26))
  335.           (setf (display-max-keycode display) (card8-get 27))
  336.           ;; 4 bytes unused
  337.           ;; Get the vendor string
  338.           (buffer-input display buffer-bbuf 0 (lround vendor-length))
  339.           (setf (display-vendor-name display)
  340.             (string-get vendor-length 0 :reply-buffer reply-buffer))
  341.           ;; Initialize the pixmap formats
  342.           (dotimes (i num-formats) ;; loop gathering pixmap formats
  343.         (declare (ignorable i))
  344.         (buffer-input display buffer-bbuf 0 8)
  345.         (push (make-pixmap-format :depth (card8-get 0)
  346.                       :bits-per-pixel (card8-get 1)
  347.                       :scanline-pad (card8-get 2))
  348.                         ; 5 unused bytes
  349.               (display-pixmap-formats display)))
  350.           (setf (display-pixmap-formats display)
  351.             (nreverse (display-pixmap-formats display)))
  352.           ;; Initialize the screens
  353.           (dotimes (i num-roots)
  354.         (declare (ignorable i))
  355.         (buffer-input display buffer-bbuf 0 40)
  356.         (let* ((root-id (card32-get 0))
  357.                (root (make-window :id root-id :display display))
  358.                (root-visual (card32-get 32))
  359.                (default-colormap-id (card32-get 4))
  360.                (default-colormap
  361.              (make-colormap :id default-colormap-id :display display))
  362.                (screen
  363.              (make-screen
  364.                :root root
  365.                :default-colormap default-colormap
  366.                :white-pixel (card32-get 8)
  367.                :black-pixel (card32-get 12)
  368.                :event-mask-at-open (card32-get 16)
  369.                :width  (card16-get 20)
  370.                :height (card16-get 22)
  371.                :width-in-millimeters  (card16-get 24)
  372.                :height-in-millimeters (card16-get 26)
  373.                :min-installed-maps (card16-get 28)
  374.                :max-installed-maps (card16-get 30)
  375.                :backing-stores (member8-get 36 :never :when-mapped :always)
  376.                :save-unders-p (boolean-get 37)
  377.                :root-depth (card8-get 38)))
  378.                (num-depths (card8-get 39))
  379.                (depths nil))
  380.           ;; Save root window for event reporting
  381.           (save-id display root-id root)
  382.           (save-id display default-colormap-id default-colormap)
  383.           ;; Create the depth AList for a screen, (depth . visual-infos)
  384.           (dotimes (j num-depths)
  385.             (declare (ignorable j))
  386.             (buffer-input display buffer-bbuf 0 8)
  387.             (let ((depth (card8-get 0))
  388.               (num-visuals (card16-get 2))
  389.               (visuals nil)) ;; 4 bytes unused
  390.               (dotimes (k num-visuals)
  391.             (declare (ignorable k))
  392.             (buffer-input display buffer-bbuf 0 24)
  393.             (let* ((visual (card32-get 0))
  394.                    (visual-info (make-visual-info
  395.                           :id visual
  396.                           :display display
  397.                           :class (member8-get 4 :static-gray :gray-scale
  398.                                   :static-color :pseudo-color
  399.                                   :true-color :direct-color)
  400.                           :bits-per-rgb (card8-get 5)
  401.                           :colormap-entries (card16-get 6)
  402.                           :red-mask (card32-get 8)
  403.                           :green-mask (card32-get 12)
  404.                           :blue-mask (card32-get 16)
  405.                           ;; 4 bytes unused
  406.                           )))
  407.               (push visual-info visuals)
  408.               (when (funcall (resource-id-map-test) root-visual visual)
  409.                 (setf (screen-root-visual-info screen)
  410.                   (setf (colormap-visual-info default-colormap)
  411.                     visual-info)))))
  412.               (push (cons depth (nreverse visuals)) depths)))
  413.           (setf (screen-depths screen) (nreverse depths))
  414.           (push screen (display-roots display))))
  415.           (setf (display-roots display) (nreverse (display-roots display)))
  416.           (setf (display-default-screen display) (first (display-roots display))))))
  417.       (when reply-buffer
  418.     (deallocate-reply-buffer reply-buffer))))
  419.   display)
  420.  
  421. (defun display-protocol-version (display)
  422.   (declare (type display display))
  423.   (declare (values major minor))
  424.   (values (display-protocol-major-version display)
  425.       (display-protocol-minor-version display)))
  426.  
  427. (defun display-vendor (display)
  428.   (declare (type display display))
  429.   (declare (values name release))
  430.   (values (display-vendor-name display)
  431.       (display-release-number display)))
  432.  
  433. (defun display-nscreens (display)
  434.   (declare (type display display))
  435.   (length (display-roots display)))
  436.  
  437. #+comment ;; defined by the DISPLAY defstruct
  438. (defsetf display-error-handler (display) (handler)
  439.   ;; All errors (synchronous and asynchronous) are processed by calling an error
  440.   ;; handler in the display.  If handler is a sequence it is expected to contain
  441.   ;; handler functions specific to each error; the error code is used to index the
  442.   ;; sequence, fetching the appropriate handler.  Any results returned by the handler
  443.   ;; are ignored; it is assumed the handler either takes care of the error
  444.   ;; completely, or else signals. For all core errors, the keyword/value argument
  445.   ;; pairs are:
  446.   ;;    :display display
  447.   ;;    :error-key error-key
  448.   ;;    :major integer
  449.   ;;    :minor integer
  450.   ;;    :sequence integer
  451.   ;;    :current-sequence integer
  452.   ;; For :colormap, :cursor, :drawable, :font, :gcontext, :id-choice, :pixmap, and
  453.   ;; :window errors another pair is:
  454.   ;;    :resource-id integer
  455.   ;; For :atom errors, another pair is:
  456.   ;;    :atom-id integer
  457.   ;; For :value errors, another pair is:
  458.   ;;    :value integer
  459.   )
  460.  
  461.   ;; setf'able
  462.   ;; If defined, called after every protocol request is generated, even those inside
  463.   ;; explicit with-display's, but never called from inside the after-function itself.
  464.   ;; The function is called inside the effective with-display for the associated
  465.   ;; request.  Default value is nil.  Can be set, for example, to
  466.   ;; #'display-force-output or #'display-finish-output.
  467.  
  468. (defvar *inside-display-after-function* nil)
  469.  
  470. (defun display-invoke-after-function (display)
  471.   ; Called after every protocal request is generated
  472.   (declare (type display display))
  473.   (when (and (display-after-function display)
  474.          (not *inside-display-after-function*))
  475.     (let ((*inside-display-after-function* t)) ;; Ensure no recursive calls
  476.       (funcall (display-after-function display) display))))
  477.  
  478. (defun display-finish-output (display)
  479.   ;; Forces output, then causes a round-trip to ensure that all possible
  480.   ;; errors and events have been received.
  481.   (declare (type display display))
  482.   (with-buffer-request-and-reply (display *x-getinputfocus* 16 :sizes (8 32))
  483.        ()
  484.     )
  485.   ;; Report asynchronous errors here if the user wants us to.
  486.   (report-asynchronous-errors display :after-finish-output))
  487.  
  488. (defparameter
  489.   *request-names*
  490.   '#("error" "CreateWindow" "ChangeWindowAttributes" "GetWindowAttributes"
  491.      "DestroyWindow" "DestroySubwindows" "ChangeSaveSet" "ReparentWindow"
  492.      "MapWindow" "MapSubwindows" "UnmapWindow" "UnmapSubwindows"
  493.      "ConfigureWindow" "CirculateWindow" "GetGeometry" "QueryTree"
  494.      "InternAtom" "GetAtomName" "ChangeProperty" "DeleteProperty"
  495.      "GetProperty" "ListProperties" "SetSelectionOwner" "GetSelectionOwner"
  496.      "ConvertSelection" "SendEvent" "GrabPointer" "UngrabPointer"
  497.      "GrabButton" "UngrabButton" "ChangeActivePointerGrab" "GrabKeyboard"
  498.      "UngrabKeyboard" "GrabKey" "UngrabKey" "AllowEvents"
  499.      "GrabServer" "UngrabServer" "QueryPointer" "GetMotionEvents"
  500.      "TranslateCoords" "WarpPointer" "SetInputFocus" "GetInputFocus"
  501.      "QueryKeymap" "OpenFont" "CloseFont" "QueryFont"
  502.      "QueryTextExtents" "ListFonts" "ListFontsWithInfo" "SetFontPath"
  503.      "GetFontPath" "CreatePixmap" "FreePixmap" "CreateGC"
  504.      "ChangeGC" "CopyGC" "SetDashes" "SetClipRectangles"
  505.      "FreeGC" "ClearToBackground" "CopyArea" "CopyPlane"
  506.      "PolyPoint" "PolyLine" "PolySegment" "PolyRectangle"
  507.      "PolyArc" "FillPoly" "PolyFillRectangle" "PolyFillArc"
  508.      "PutImage" "GetImage" "PolyText8" "PolyText16"
  509.      "ImageText8" "ImageText16" "CreateColormap" "FreeColormap"
  510.      "CopyColormapAndFree" "InstallColormap" "UninstallColormap" "ListInstalledColormaps"
  511.      "AllocColor" "AllocNamedColor" "AllocColorCells" "AllocColorPlanes"
  512.      "FreeColors" "StoreColors" "StoreNamedColor" "QueryColors"
  513.      "LookupColor" "CreateCursor" "CreateGlyphCursor" "FreeCursor"
  514.      "RecolorCursor" "QueryBestSize" "QueryExtension" "ListExtensions"
  515.      "SetKeyboardMapping" "GetKeyboardMapping" "ChangeKeyboardControl" "GetKeyboardControl"
  516.      "Bell" "ChangePointerControl" "GetPointerControl" "SetScreenSaver"
  517.      "GetScreenSaver" "ChangeHosts" "ListHosts" "ChangeAccessControl"
  518.      "ChangeCloseDownMode" "KillClient" "RotateProperties" "ForceScreenSaver"
  519.      "SetPointerMapping" "GetPointerMapping" "SetModifierMapping" "GetModifierMapping"))
  520.